package com.tesis_2.UI;

import com.example.tesis_2.R;
import com.example.tesis_2.R.layout;
import com.example.tesis_2.R.menu;
import com.tesis_2.BL.BLLocales;
import com.tesis_2.BL.BLRestaurants;
import com.tesis_2.MO.MOLocal;
import com.tesis_2.MO.MORestaurant;
import com.tesis_2.Utils.UTLocalesCategoryAdapter;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;

public class UILocalesDetailItem extends Fragment {
	
	private MOLocal objLocal;
	
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
	// Inflate the layout for this fragment
	View fragmentView = inflater.inflate(R.layout.activity_locales_detail_item, container, false);
	Bundle args = getArguments();
	objLocal = BLLocales.getLsLocal().get(args.getInt("nLocal"));
	
	((TextView) fragmentView.findViewById(R.id.txvNombre_locales_detail_item)).setText(objLocal.getName());
	((TextView) fragmentView.findViewById(R.id.txvRestName_locales_detail_item)).setText(BLRestaurants.getRestById(objLocal.getRest_id()).getName()); //
	((TextView) fragmentView.findViewById(R.id.txvDescripcion_locales_detail_item)).setText(objLocal.getDescr());
	((TextView) fragmentView.findViewById(R.id.txvDireccionD_locales_detail_item)).setText(objLocal.getAddr1());
	((TextView) fragmentView.findViewById(R.id.txvTelefono1D_locales_detail_item)).setText(objLocal.getPhone1());
	((TextView) fragmentView.findViewById(R.id.txvTelefono2D_locales_detail_item)).setText(objLocal.getPhone2());
	((TextView) fragmentView.findViewById(R.id.txvCapacidadD_locales_detail_item)).setText(objLocal.getCapacity().toString());
	((RatingBar) fragmentView.findViewById(R.id.rbLocal_locales_detail_item)).setRating(objLocal.getRate());
	
	return  fragmentView;
	
	}
	

}
